pictures = {}

path = "profile_1234.png"

if path not in pictures:
    try:
        handle = open(path, "a+b")
    except OSError:
        print("打开文件失败")
        raise
    else:
        pictures[path] = handle
else:
    handle = pictures[path]

handle.seek(0)
image_data = handle.read()
